import { get, post } from '@/utils/request'
const BASE_URL = window.baseUrl.ticket

/** 流程列表 */
export function flowPageList(query) {
  return post(BASE_URL + '/flow/pageList', query)
}

/** 删除 */
export function deleteFlow(query) {
  return get(BASE_URL + '/flow/deleteByIds?ids=' + query)
}

/** 启用 */
export function flowEnable(query) {
  return get(BASE_URL + '/flow/enable?ids=' + query)
}

/** 禁用 */
export function flowDisable(query) {
  return get(BASE_URL + '/flow/disable?ids=' + query)
}

/** 下线 */
export function flowOffline(query) {
  return get(BASE_URL + '/flow/offline?ids=' + query)
}

/** 发布 */
export function flowPublish(query) {
  return get(BASE_URL + '/flow/publish?ids=' + query)
}

/** 新增流程 */
export function flowCreate(query) {
  return post(BASE_URL + '/flow/create', query)
}

/** 更新流程 */
export function flowUpdate(query) {
  return post(BASE_URL + '/flow/update', query)
}

/** 获取所有表单列表 */
export function getAllFormList(query) {
  return get(BASE_URL + '/formDef/findAll', query)
}

/** 获取所有角色列表 */
export function getAllRoleList(query) {
  return get(BASE_URL + '/commonRole/allRole', query)
}

/** 获取所有用户列表 */
export function getAllUserList(query) {
  return get(BASE_URL + '/commonUser/getAllUser', query)
}

/** 根据id获取流程信息：预览 */
export function getProcessInfo(query) {
  return get(BASE_URL + '/flow/get', query)
}

/** 根据id获取流程 */
export function getProcessDetail(query) {
  return get(BASE_URL + '/flow/getById?id=' + query)
}